Many software applications are written in weakly-typed languages such as C and C++. In such applications, there are often pervasive uses of pointers and pointer-based dynamic data structures. Programs written in those languages are often optimized to, for example, exploit instruction level parallelism or data locality for efficient memory access. The effectiveness of such optimization schemes depends substantially on the ability of the compiler to disambiguate pointer-based memory references accurately and to recognize the type-cast relationships among structures.
A major impediment to disambiguation of memory references in C or C++ is their weak type system. This is particularly attributed to type-casts. Due to type-casting, pointer de-references can not be safely disambiguated according to the declared types of the underlying pointers. Similarly, type-casting also hinders compiler optimizations that rely on modification to the signature of user-defined structure types. For example, data locality may be optimized to enhance memory performance through field re-ordering, structure splitting, and N-bit pointer identification. However, any structure that is type-cast to another structure can not be safely split and vice versa.